/*
 * @Author: LG
 * @Date: 2020-09-20 10:38:19
 * @Description: 
 * @Last Modified By: LG
 * @Last Modified Time: 2020-09-20 11:43:22
 */
import {observable,action, toJS} from 'mobx'
class UserStore{
    @observable user:{name:string}={
        name:'alex'
    }
    @action setUser=(data:{name:string})=>{
        this.user = {...data}
    }
    @action setUserName =(name:string)=>{
        console.log(name)
        this.user.name = name
        console.log(toJS(this.user))
        // this.user ={
        //     ...this.user,
        //     name
        // }
    }
}
export default new UserStore()